home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / online / files / fedemon.exe / {app} / Data / defaults / styles / Simple.fdxsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-08-31  |  4.0 KB  |  112 lines

  1. <?xml version="1.0"?>
  2.  
  3. <xsl:stylesheet version="1.0"
  4.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.     xmlns:fd="http://www.bradsoft.com/feeddemon/xmlns/1.0/">
  6. <xsl:output method="html"/>
  7.  
  8. <xsl:variable name="common-styles">
  9.     <style type="text/css">
  10.         body { font: 11pt/17pt "Trebuchet MS", Tahoma, sans-serif; margin: 8px 10px; color: #1F1F1F; background-color: white; }
  11.         a { color: #006ABA;  }
  12.         a:hover { color: #6F94C3; }
  13.         span.nodescription {    font-size: x-small; color: silver;}
  14.         div.newspapertitle { font-weight: bold; font-size: 130%; text-align: center; margin: 16px 2px; }
  15.         div.newsitem { /*border: 1px dotted #484848;*/ padding: 18px 24px; background-color: white; }
  16.         div.newsitemtitle { font-weight: bold; } 
  17.         div.newsitemfooter { font-size: xx-small; text-align: left; margin-bottom: 8px;  }
  18.         div.newsitemfooter, div.newsitemfooter a { color: #AEAEAE; }
  19.         <xsl:if test="newspaper[@type != 'newsitem']">
  20.             div.newsitem {
  21.                 border-bottom: 1px dotted #D8D8D8;
  22.             }
  23.         </xsl:if>            
  24.     </style>
  25. </xsl:variable>
  26.  
  27. <!-- channel group -->
  28. <xsl:template match="newspaper[@type='group']">
  29.     <html>
  30.     <head>
  31.         <title>Group Newspaper</title>
  32.         <xsl:copy-of select="$common-styles"/>
  33.         <style type="text/css">
  34.             div.channelnewsitems, div.channeltitle { border: 1px solid #CCCCCC; }
  35.             div.channelnewsitems { padding: 8px 12px; margin-bottom: 12px; }
  36.             div.channeltitle { border-bottom: none; font-weight: bold; text-transform: uppercase; color: #534700; text-align: center; }        
  37.         </style>
  38.     </head>
  39.     <body>
  40.         <xsl:variable name="newspapertype" select="@type"/>
  41.         <xsl:if test="title">
  42.             <div class="newspapertitle">
  43.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  44.             </div>
  45.         </xsl:if>
  46.         
  47.         <xsl:for-each select="channel">
  48.             <div class="channeltitle">
  49.                 <xsl:value-of select="title"/>
  50.             </div>
  51.             <div class="channelnewsitems">        
  52.                 <xsl:for-each select="item">
  53.                     <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  54.                     <xsl:apply-templates select="."/>
  55.                 </xsl:for-each>
  56.             </div>
  57.         </xsl:for-each>    
  58.     </body>
  59.     </html>
  60. </xsl:template>
  61.  
  62. <!-- news item and channel -->
  63. <xsl:template match="newspaper[@type='newsitem' or @type='channel']">
  64.     <html>
  65.     <head>
  66.         <title>Newspaper</title>
  67.         <xsl:copy-of select="$common-styles"/>
  68.     </head>
  69.     <body>
  70.         <xsl:if test="title">
  71.             <div class="newspapertitle">
  72.                 <xsl:value-of select="title" disable-output-escaping="yes"/>
  73.             </div>
  74.         </xsl:if>
  75.         <xsl:for-each select="channel/item">
  76.             <xsl:sort select="fd:sortKey" data-type="number" order="descending"/>
  77.             <xsl:apply-templates select="."/>
  78.         </xsl:for-each>
  79.     </body>
  80.     </html>    
  81. </xsl:template>
  82.  
  83. <!-- news item template -->
  84. <xsl:template match="item">
  85.     <div class="newsitem">
  86.        <div class="newsitemtitle">
  87.             <xsl:variable name="itemlink" select="link"/>
  88.            <a href="{$itemlink}"><xsl:value-of select="title" disable-output-escaping="yes"/></a>
  89.         </div>            
  90.         <div class="newsitemfooter">
  91.             <xsl:variable name="srclink" select="source/@htmlUrl"/>
  92.             <xsl:value-of select="fd:dateDisplay"/> | <a href="{$srclink}"><xsl:value-of select="source"/></a>
  93.             <!-- add link to comments if available -->
  94.             <xsl:if test="comments">
  95.                 <xsl:variable name="commentlink" select="comments"/>
  96.                 <xsl:variable name="commentimg" select="'$IMAGEDIR$comments.gif'"/>
  97.                 | <a href="{$commentlink}"><img src="{$commentimg}" border="0" hspace="3" align="absmiddle" /></a>
  98.             </xsl:if>
  99.             <!-- add link to enclosure if available -->
  100.             <xsl:if test="enclosure">
  101.                 <xsl:variable name="enclosurelink" select="enclosure/@url"/>
  102.                 <xsl:variable name="enclosureimg" select="'$IMAGEDIR$enclosure.gif'"/>
  103.                 | <a href="{$enclosurelink}" title="{$enclosurelink}"><img src="{$enclosureimg}" border="0" hspace="3" align="absmiddle" /></a>
  104.             </xsl:if>
  105.         </div>
  106.         <div class="newsitemcontent">
  107.             <xsl:value-of select="description" disable-output-escaping="yes"/>
  108.         </div>
  109.     </div>
  110. </xsl:template>
  111.  
  112. </xsl:stylesheet>